/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.dao.impl;

import cn.yzc.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * <p>Project: SpringPro - OrderDaoImpl</p>
 * <p>Powered by yzc On 2023-10-23 15:12:46</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */

@Repository
public class OrderDaoImpl implements OrderDao {

    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public int saveOrder(String oid, String name, String address, double amount, int state) {
        String sql = "insert into orders(oid,name,address,amount,state) values(?,?,?,?,?)";
        int rs = jdbcTemplate.update(sql, oid, name, address, amount, state);
        return rs;
    }
}
